/*
 *
 *
 *
 *
 */

package com.usefullc.system.domain;

import com.usefullc.system.entity.BaseEntity;
import com.usefullc.system.service.component.dict.DictField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 数据字典，可以多级，可包含枚举特征
 */
@Entity(name="sys_data_dict")
@ApiModel("字典")
@Table(
//        indexes = {@Index(name = "data_dict_index", columnList = "", unique = true), }
)
@Data
public class DataDict extends BaseEntity {


    @ApiModelProperty(notes = "编码--字典关系唯一值")
    @Column(length = 50,nullable = false,unique = true)
    private String code;

    @ApiModelProperty(notes = "名称--字典label")
    @Column(length = 50,nullable = false)
    private String name;

    @ApiModelProperty(notes = "值--字典值")
    @Column(length = 500,nullable = false)
    private String value;

    @DictField(value="dataDictType")
    @ApiModelProperty(notes = "数据类型")
    @Column(length = 500,nullable = false)
    private Integer type;

    @ApiModelProperty(notes = "父ID")
    @Column(length = 20, nullable = false)
    private Long parentId;

    @ApiModelProperty(notes = "序号")
    @Column(length = 4, nullable = false)
    private Integer orderNo;

    @ApiModelProperty(notes = "描述")
    @Column(length = 200,nullable = true)
    private String description;

    public DataDict(){
    }


}
